export function getStorage(key: string) {
  try {
    return JSON.parse(localStorage.getItem(key) ?? '');
  } catch (e) {
    return undefined;
  }
}

export function setStorage(key: string, obj: any) {
  localStorage.setItem(key, JSON.stringify(obj));
}